/**
 * Copyright (c) 2019-2020. code260.com
 */
package com.code260.ss.spring3mybatis.demo;

import java.io.IOException;

import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;

/**
 * @author code260@qq.com
 *
 */
public class ClasspathScanTest {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		PathMatchingResourcePatternResolver pathMatchingResourcePatternResolver = new PathMatchingResourcePatternResolver();
		
		/**
		 * *表示一级目录
		 * ** 表示多级目录
		 * ? 表示一个字符
		 * 
		 */
		Resource[] resources = pathMatchingResourcePatternResolver.getResources("classpath*:org/springframework/core/**/*.class");
		for (Resource resource : resources) {
			System.out.println(resource);
		}
		System.out.println("====1====");
		resources = pathMatchingResourcePatternResolver.getResources("classpath*:org/springframework/core/*/*.class");
		for (Resource resource : resources) {
			System.out.println(resource);
		}
		System.out.println("====2====");
		resources = pathMatchingResourcePatternResolver.getResources("classpath*:com/code260/ss/spring3mybatis/demo/Test*.class");
		for (Resource resource : resources) {
			System.out.println(resource);
		}
		System.out.println("====3====");
		resources = pathMatchingResourcePatternResolver.getResources("classpath*:com/code260/ss/spring3mybatis/demo/Test?.class");
		for (Resource resource : resources) {
			System.out.println(resource);
		}
		
		resources = pathMatchingResourcePatternResolver.getResources("classpath:com/code260/ss/spring3mybatis/demo/Test*.class");
		for (Resource resource : resources) {
			System.out.println(resource);
		}
		System.out.println("====4====");
		
		resources = pathMatchingResourcePatternResolver.getResources("classpath:com/code260/**/Test*.class");
		for (Resource resource : resources) {
			System.out.println(resource);
		}
		System.out.println("====5====");
	}

}
